package com.alibaba.springbootrbac.utils;

import lombok.Getter;

/**
 * 自定义业务异常类
 * 用于抛出可预期的业务错误
 */
@Getter
public class BizException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    // 状态码
    private final Integer code;

    // 只传 message，默认 500
    public BizException(String message) {
        super(message);
        this.code = 400;
    }

    // 传 code + message
    public BizException(Integer code, String message) {
        super(message);
        this.code = code;
    }
}
